import request from '@/utils/request'

// 获取组织架构数据
export function reqGetDepartments() {
  return request({
    method: 'get',
    url: '/company/department'
  })
}
// 删除部门
export function reqDelDepartment(id) {
  return request({
    method: 'delete',
    url: `/company/department/${id}`
  })
}

// 点击添加部门
export function reqAddDepartment(data) {
  return request({
    method: 'post',
    url: '/company/department',
    data
  })
}

/** *
 * 获取部门详情
 * ***/
export function reqGetDepartDetail(id) {
  return request({
    url: `/company/department/${id}`
  })
}

// 根据id更新部门
export function reqUpdateDepartments(form) {
  return request({
    method: 'put',
    url: `/company/department/${form.id}`,
    data: form
  })
}

